<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of AddRole
 *
 * @author ghazy
 */
class Application_Form_AddRole extends Zend_Form {

    public function  init() {

        //***here will set action and method

        $name = new Zend_Form_Element_Text('rolename');
        $name->setLabel('Role_Name')
             ->setOptions(array('size' => '50'))
             ->setRequired(true)
             ->setValue('enter role-name')
             ->addFilter(new Zend_Filter_HtmlEntities())
             ->addFilter(new Zend_Filter_StringTrim())
             ->addValidator('Alpha',false,array('allowWhiteSpace' => false))
             ->addValidator('NotEmpty',true);

        //doctrine ---> every permission has its own checkbox
        $permission_name = new Zend_Form_Element_Checkbox('permission');;
        $permission_name->setLabel('permission_name');

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Add_User');

        $reset = new Zend_Form_Element_Reset('reset');
        $reset->setLabel('Reset');

        $this->addElement($name)
             ->addElement($permission_name)
             ->addElement($reset)
             ->addElement($submit);

    }
}
?>
